﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RWLib
{
    public abstract class StatementBase : IComparable
    {
        protected String name;
        protected int startTime;

        protected Formula _ImpossibleCondition;
        protected List<int> _ImpossibleTimes;
        protected int _currentTimes;

        protected TriggerStatement triggeredBy;

        protected bool performed=false;

        public bool Performed {
            get { return performed; }
        }

        public TriggerStatement TriggeredBy {
            get { return triggeredBy; }
            set { triggeredBy= value; }
        }

        public int StartTime {
            get { return startTime; }
            set { startTime = value; }
        }

        public int CurrentTime
        {
            get { return _currentTimes; }
            set { _currentTimes = value; }
        }

        public List<int> ImpossibleTimes {
            get { return _ImpossibleTimes; }
            set { _ImpossibleTimes=value; }
        }        

        public string Name {
            get { return name; }
        }

        public Formula ImpossibleCondition
        {
            get { return _ImpossibleCondition; }  
            set { _ImpossibleCondition=value; }
        }

        abstract public List<List<Fluent>> Run(List<Fluent> fluents);

        public virtual bool Conflict(StatementBase action, List<Fluent> state) {
            return false;
        }

        public virtual int CompareTo(object obj) {
            return -1;
        }
    }
}